/**
 * author      : dormi330
 * date        : 2018/6/27
 * project     : mybatis
 * description : 添加包裹信息
 */

package com.deep.trade.order;

import com.deep.trade.BaseDto;

import java.util.ArrayList;
import java.util.List;

public class InDtoEachParcel extends BaseDto {
    /*
    {
        tenantCode,
        token,
        tradeOrderId,
        logisticsCompanyName
        deliveryCompanyCod
        parcelItemList: [ {tradeOrderSkuId, 1}, {tradeOrderSkuId, 2}]
    }
    */

    private String token;                       // token
    private String tenantCode;                  // 租户
    private String tradeOrderId;                //
    private List<ParcelItem> parcelItemList;    // 包裹内容
    private String trackingNo;                  // 物流单号
    private String trackingNoImg;               // 物流图片, 目前可选
    private String logisticsCompanyName;        // 投递公司名
    private String logisticsCompanyCode;        // 投递公司编码

    public InDtoEachParcel() {
    }

    public InDtoEachParcel(
            String tenantCode,
            String token,
            String tradeOrderId,
            String trackingNo,
            String trackingNoImg,
            String logisticsCompanyName,
            String logisticsCompanyCode) {
        this.tenantCode = tenantCode;
        this.token = token;
        this.tradeOrderId = tradeOrderId;
        this.trackingNo = trackingNo;
        this.trackingNoImg = trackingNoImg;
        this.logisticsCompanyName = logisticsCompanyName;
        this.logisticsCompanyCode = logisticsCompanyCode;
    }

    public InDtoEachParcel addParcelItem(String tradeOrderSkuId, int quantity) {
        if (null == parcelItemList) parcelItemList = new ArrayList<>();
        parcelItemList.add(new ParcelItem(tradeOrderSkuId, quantity));
        return this;
    }

    //  === setter / getter ===


    public String getTrackingNo() {
        return trackingNo;
    }

    public void setTrackingNo(String trackingNo) {
        this.trackingNo = trackingNo;
    }

    public String getTrackingNoImg() {
        return trackingNoImg;
    }

    public void setTrackingNoImg(String trackingNoImg) {
        this.trackingNoImg = trackingNoImg;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getTenantCode() {
        return tenantCode;
    }

    public void setTenantCode(String tenantCode) {
        this.tenantCode = tenantCode;
    }

    public String getTradeOrderId() {
        return tradeOrderId;
    }

    public void setTradeOrderId(String tradeOrderId) {
        this.tradeOrderId = tradeOrderId;
    }

    public List<ParcelItem> getParcelItemList() {
        return parcelItemList;
    }

    public void setParcelItemList(List<ParcelItem> parcelItemList) {
        this.parcelItemList = parcelItemList;
    }

    public String getLogisticsCompanyName() {
        return logisticsCompanyName;
    }

    public void setLogisticsCompanyName(String logisticsCompanyName) {
        this.logisticsCompanyName = logisticsCompanyName;
    }

    public String getLogisticsCompanyCode() {
        return logisticsCompanyCode;
    }

    public void setLogisticsCompanyCode(String logisticsCompanyCode) {
        this.logisticsCompanyCode = logisticsCompanyCode;
    }
}
